#pragma once

#include<string.h>
#include<assert.h>
#include<iostream>

using namespace std;

namespace yyh
{
	class string
	{
	public:
		string(const char* str = "");
		const char* c_str()const
		{
			return _str;
		}
		~string();
		void push_back(char ch);
		void append(const char* str);
		void reserve(size_t n);
		string& operator +=(char ch);
		string& operator +=(const char* str);
		void insert(size_t pos, size_t n, char ch);
		void insert(size_t pos, const char* str);
		void erase(size_t pos = 0, size_t len = npos);
	private:
		char* _str;
		size_t _size;
		size_t _capacity;
		const static size_t npos;
	};

	void test1();
}